<template>
	<view>
		<Header title="修改电话号码" bgColor="#FFFFFF" :showBack="true"></Header>
		
		<view class="info">
			<view>学校：{{schoolName}}</view>
			<view>班级：{{className}}</view>
			<view>姓名：{{ownerName}}</view>
		</view>
		<view class="changPhone">
			<view>预留号码：{{oldPhone}}</view>
			<view>本机号码：{{newPhone}}</view>
		</view>
		<button @click="summit" type="default">确认修改</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ownerName:'',
				schoolName:'',
				className:'',
				gradeId:'',
				id:'',
				newPhone:'',
				oldPhone:'',
				organizationId:'',
				isGZH:false
			}
		},
		onLoad(e) {
			console.log(e)
			this.className = e.className
			this.gradeId = e.gradeId
			this.id = e.id
			this.newPhone = e.newPhone
			this.oldPhone = e.oldPhone
			this.organizationId = e.organizationId
			this.ownerName = e.ownerName
			this.schoolName = e.schoolName
			this.isCard = e.isCard ? e.isCard : null
			if(e.isGZH==1){
				this.isGZH = true
			}
		},
		methods: {
			summit(){
				this.$http('/minprogram/api/member/saveOwnerStudent',{
					"ownerName": this.ownerName,
					"organizationId": this.organizationId,
					"gradeId": this.gradeId,
					"id":this.id,
					"isCard": this.isCard
				},res1=>{
					if(res1.data.value){
						if(this.isGZH){
							uni.reLaunch({
								url:'/pages/niuniuIndex/niuniuIndex?type=2'
							})
						}else{
							uni.reLaunch({
								url:'/pages/index/index?type=2'
							})
						}
					}
				})
			}
		}
	}
</script>

<style scoped lang="less">
.info{
	width: 95%;
	background-color: #FFFFFF;
	border-radius: 10upx;
	margin: 20upx auto;
	padding: 30upx 0;
	>view{
		padding: 0 50upx;
		height: 80upx;
		line-height: 80upx;
	}
}
.changPhone{
	width: 95%;
	background-color: #FFFFFF;
	border-radius: 10upx;
	margin: 20upx auto;
	padding: 30upx 0;
	>view{
		height: 100upx;
		line-height: 100upx;
		font-size: 40upx;
		font-weight: 600;
		text-align: center;
	}
}
button{
	background-color: #2BAC6B;
	width: 90%;
	height: 96upx;
	line-height: 96upx;
	text-align: center;
	color: #FFFFFF;
	font-size: 30upx;
	margin: 30upx auto;
	border-radius: 10upx;
}
</style>
